---
sidebar_label: Together AI
---

# Together AI

The `TogetherAIEmbeddings` class uses the Together AI API to generate embeddings for a given text.

## Setup

In order to use the Together API you'll need an API key. You can sign up for a Together account and create an API key [here](https://api.together.xyz/).

You'll first need to install the [`@langchain/community`](https://www.npmjs.com/package/@langchain/community) package:

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/community
```

## Usage

import CodeBlock from "@theme/CodeBlock";
import TogetherExample from "@examples/embeddings/togetherai.ts";

<CodeBlock language="typescript">{TogetherExample}</CodeBlock>
